﻿using NetDimension.NanUI;
using NetDimension.NanUI.Browser;
using NetDimension.NanUI.HostWindow;
using NetDimension.NanUI.JavaScript;
using PLM.Configuration.Center.NanUIApp.Formiums;
using PLM.ConfigurationCenter.Core.Expansion;
using PLM.ConfigurationCenter.Model;
using PLM.ConfigurationCenter.SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace PLM.Configuration.Center.NanUIApp.Windows {
    public class SystemSettingWindow : Formium {

     
        // 设置窗体样式类型
        public override HostWindowType WindowType => HostWindowType.Borderless;

        public override string StartUrl => $"http://res.app.local/pages/systemsetting.html";

        public SystemSettingWindow() {
            // 在此处设置窗口样式
            Size = new Size(800, 600);
            this.StartPosition = FormStartPosition.CenterParent;
        }
        
        protected override void OnReady() {
            LoadEnd += PageLoadEnd;

            var fevent = new FormiumEvent(this);
            //注册公共事件
            fevent.RegisterCommonEvent();

        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void PageLoadEnd(object? sender, LoadEndEventArgs e) {
            if (e.Frame.IsMain) {
                SplashScreen.Hide();
            }
        }
       
    }
}
